package com.xxm.opengl.triangle

import android.opengl.GLES30
import android.opengl.GLSurfaceView
import androidx.databinding.DataBindingUtil
import com.xxm.opengl.R
import com.xxm.opengl.databinding.ActivityTriangleBinding
import com.zhangws.comman.base.BaseActivity

class TriangleActivity : BaseActivity<ActivityTriangleBinding>() {

    init {
        System.loadLibrary("opengl")
    }

    override fun getViewDataBinding(): ActivityTriangleBinding
    =DataBindingUtil.setContentView(this, R.layout.activity_triangle) as ActivityTriangleBinding

    override fun initView() {
        val render=Render()
        viewBinding.surfaceView.setEGLContextClientVersion(3)
        viewBinding.surfaceView.setRenderer(render)
        viewBinding.surfaceView.renderMode=GLSurfaceView.RENDERMODE_WHEN_DIRTY
    }

    override fun initListener() {

    }

    override fun initData() {

    }

    override fun onResume() {
        super.onResume()
        viewBinding.surfaceView.onResume()
    }

    override fun onPause() {
        super.onPause()
        viewBinding.surfaceView.onPause()
    }



}